#include <stdio.h>
#include <fcntl.h>
#include <string.h>
#include <linux/limits.h>
#include "rocerror.h"  // 添加头文件 `#include "rocerror.h"`

int main(int argc, char *argv[]) {
    char filename[PATH_MAX] = { 0 };

    // 替换参数错误处理为 `app_error`
    if (argc != 2) {
        app_error("You must supply a filename as an argument");
    }

    strncpy(filename, argv[1], PATH_MAX - 1);
    filename[PATH_MAX - 1] = '\0';

    // 替换 `creat` 错误处理为 `unix_error`
    if (creat(filename, 0644) == -1) {
        unix_error("Can't create file");
    }

    return 0;
}
